package libs

import (
	"fmt"
)

type Reader interface {
	ReadBook()
}

type Writer interface {
	WriteBook()
}

type Book struct {
}

func (b *Book) ReadBook() {
	fmt.Println("Read a book")
}

func (b *Book) WriteBook() {
	fmt.Println("Write a book")
}

func AssertShow() {
	/* 	var a = "hello"
	   	var b interface{} = a

	   	fmt.Println(a, b)

	   	str, ok := b.(int)
	   	if ok {
	   		fmt.Println(str)
	   	} else {
	   		fmt.Println("err")
	   	}
	*/

	book := Book{}
	b := &book
	// b.ReadBook()

	var r Reader
	r = b
	// r.ReadBook()

	w := r.(Writer)
	w.WriteBook()

}
